package com.example.demo.service;

import com.example.demo.entity.Goods;
import org.springframework.http.ResponseEntity;

import java.util.Map;

/**
 * @description goods
 * @author yixin
 * @date 2025-06-12
 */
public interface GoodsService {

    /**
    * 新增
    */
    public Object insert(Goods goods);

    /**
    * 删除
    */
    public Object delete(int id);

    /**
    * 更新
    */
    public Object update(Goods goods);

    /**
    * 根据主键 id 查询
    */
    public Goods load(int id);

    /**
    * 分页查询
    */
    public Map<String,Object> pageList(int offset, int pagesize);

    ResponseEntity<Object> processOrder(int id) throws InterruptedException;

    ResponseEntity<Object> seckill(int id)throws InterruptedException;

    ResponseEntity<Object> processOrderAndPay(int id, String userId)throws InterruptedException;
}